Data Structures |
| union | LINUARTConfig_t |
Defines |
|
#define | TRUE (1u) |
|
#define | CLEAR (0u) |
|
#define | BITS_IN_NIBBLE (4u) |
|
#define | BITS_IN_BYTE (8u) |
|
#define | BITS_IN_32 (32u) |
|
#define | BITS_IN_16 (16u) |
|
#define | BYTES_IN_32 (4u) |
|
#define | BYTES_IN_16 (2u) |
|
#define | BIT_DEFINITION |
|
#define | BIT0 (1u << 0u) |
|
#define | BIT1 (1u << 1u) |
|
#define | BIT2 (1u << 2u) |
|
#define | BIT3 (1u << 3u) |
|
#define | BIT4 (1u << 4u) |
|
#define | BIT5 (1u << 5u) |
|
#define | BIT6 (1u << 6u) |
|
#define | BIT7 (1u << 7u) |
|
#define | BIT8 (1u << 8u) |
|
#define | BIT9 (1u << 9u) |
|
#define | BIT10 (1u << 10) |
|
#define | BIT11 (1u << 11) |
|
#define | BIT12 (1u << 12) |
|
#define | BIT13 (1u << 13) |
|
#define | BIT14 (1u << 14) |
|
#define | BIT15 (1u << 15) |
|
#define | BIT16 (1u << 16) |
|
#define | BIT17 (1u << 17) |
|
#define | BIT18 (1u << 18) |
|
#define | BIT19 (1u << 19) |
|
#define | BIT20 (1u << 20) |
|
#define | BIT21 (1u << 21) |
|
#define | BIT22 (1u << 22) |
|
#define | BIT23 (1u << 23) |
|
#define | BIT24 (1u << 24) |
|
#define | BIT25 (1u << 25) |
|
#define | BIT26 (1u << 26) |
|
#define | BIT27 (1u << 27) |
|
#define | BIT28 (1u << 28) |
|
#define | BIT29 (1u << 29) |
|
#define | BIT30 (1u << 30) |
|
#define | BIT31 (1u << 31) |
| #define | N_LIN_INSTANCES (2u) |
|
#define | UART_PHYSICAL_BUFF_SIZE (4u) |
|
#define | SCI_TIME_OUT (0x00040000u) |
|
#define | LIN_UART_ENABLED (0x80000000u) |
|
#define | LIN_UART_DISABLED (0x00000000u) |
|
#define | LIN_TX_BUFF_1_BYTES (0x00000000u) |
|
#define | LIN_TX_BUFF_2_BYTES (0x20000000u) |
|
#define | LIN_TX_BUFF_3_BYTES (0x40000000u) |
|
#define | LIN_TX_BUFF_4_BYTES (0x60000000u) |
|
#define | LIN_RX_BUFF_1_BYTES (0x00000000u) |
|
#define | LIN_RX_BUFF_2_BYTES (0x08000000u) |
|
#define | LIN_RX_BUFF_3_BYTES (0x10000000u) |
|
#define | LIN_RX_BUFF_4_BYTES (0x18000000u) |
|
#define | LIN_NO_PARITY_CHECK (0x00000000u) |
|
#define | LIN_ODD_PARITY_CHECK (0x06000000u) |
|
#define | LIN_EVEN_PARITY_CHECK (0x02000000u) |
|
#define | LIN_7_BIT_WORD_SIZE (0x00000000u) |
|
#define | LIN_8_BIT_WORD_SIZE (0x01000000u) |
|
#define | UART_NO_DATA_RX ((uint8_t)BIT7) |
|
#define | UART_INVALID_BUFFER_SIZE ((uint8_t)BIT2) |
|
#define | UART_TIMEOUT ((uint8_t)BIT1) |
|
#define | UART_NOT_READY ((uint8_t)BIT0) |
|
#define | LIN_MANTISSA(xx) (xx << 8u) |
|
#define | LIN_FRACTION(xx) (xx << 20u) |
Typedefs |
|
typedef struct LINFLEX_tag * | LINFLEX_t |
Enumerations |
| enum | LIN_STATE_MACHINE_STATES {
LIN_ASLEEP = 0,
LIN_INIT,
LIN_IDLE,
LIN_BREAK,
LIN_BREAK_DELIMITER,
LIN_SYNCH_FIELD,
LIN_ID_FIELD,
LIN_HEADER_DONE,
LIN_DATA_TX_RX,
LIN_CHECKSUM
} |
| enum | LIN_INSTANCES_LIST { LIN_INSTANCE_0 = 0,
LIN_INSTANCE_1,
LIN_INSTANCE_2,
LIN_INSTANCE_3
} |
| enum | LIN_UART_BUFFER_REGISTERS { UART_BUFF0 = 0u,
UART_BUFF1,
UART_BUFF2,
UART_BUFF3
} |
Functions |
| uint8_t | u8fnUARTWrite (const uint8_t u8Instance, const uint8_t *pu8UARTTx, const uint8_t u8Size) |
| | This function will write n number of bytes to the UART. If this operation is not successful after some time, the routine will time-out. It will wait inside the function until all data has been transmitted.
|
| uint8_t | u8fnUARTRead (const uint8_t u8Instance, const uint8_t *pu8UARTRx, const uint8_t u8Size) |
| | This function will read n number of bytes from the UART and place them in an array before exiting. If the number is not achieved, the routine will time-out eventually.
|
| uint8_t | u8fnLINUARTSend (const uint8_t u8Instance, const uint8_t *pu8UARTTx, const uint8_t u8Size) |
| | This function will start writing data through the UART. The remaining data will be sent eventually through interrupts. It will NOT wait for all data to be sent before exiting.
|
| uint8_t | u8fnLINUARTReceive (const uint8_t u8Instance, const uint8_t *pu8UARTRx, const uint8_t u8IsrEn) |
| | This function will enable data to be received via a UART, and will allow data to keep flowing in indefinitely. This function will NOT wait for data to be ready before it exits.
|
| uint8_t | u8fnConfigLINUARTGeneral (const LINUARTConfig_t *tLINUARTConfig) |
| | This function will configure a particular instance of the LIN peripheral for use as a UART/SCI.
|
| uint8_t | u8fnLINUARTGetDataNoIsr (uint8_t u8Instance) |
| | Gathers data from the buffer without using Isrs.
|
| uint8_t | u8fnWaitForUARTTxBufferToEmpty (uint8_t u8Instance, uint32_t u32TimeOut) |
| | This function will wait for the Interrupts Enable bit to turn off or time-out while doing so. The purpose of such routine is to make sure not to start a new buffer transmission while there's one ongoing.
|
| void | vfnEnableLINRxISR (uint8_t u8Instance, uint8_t u8Switch) |
| | This internal function will enable or disable Reception interrupts.
|
| void | vfnEnableLINTxISR (uint8_t u8Instance, uint8_t u8Switch) |
| | This internal function will enable or disable transmission interrupts.
|
| void | vfnLIN0TxIsr (void) |
| | Interrupt Service routine for data transmission of Instance 0. This routine will call vfnGenericLINTxIsr.
|
| void | vfnLIN1TxIsr (void) |
| | Interrupt Service routine for data transmission of Instance 1. This routine will call vfnGenericLINTxIsr.
|
| void | vfnLIN2TxIsr (void) |
| | Interrupt Service routine for data transmission of Instance 2. This routine will call vfnGenericLINTxIsr.
|
| void | vfnLIN3TxIsr (void) |
| | Interrupt Service routine for data transmission of Instance 3. This routine will call vfnGenericLINTxIsr.
|
| void | vfnLIN0RxIsr (void) |
| | Interrupt Service routine for data reception of Instance 0. This routine will call vfnGenericLINTxIsr.
|
| void | vfnLIN1RxIsr (void) |
| | Interrupt Service routine for data reception of Instance 1. This routine will call vfnGenericLINTxIsr.
|
| void | vfnLIN2RxIsr (void) |
| | Interrupt Service routine for data reception of Instance 2. This routine will call vfnGenericLINTxIsr.
|
| void | vfnLIN3RxIsr (void) |
| | Interrupt Service routine for data reception of Instance 3. This routine will call vfnGenericLINTxIsr.
|
Variables |
| vuint8_t | gau8LINUARTWordsTx [N_LIN_INSTANCES] |
| vuint8_t | gau8LINUARTWordsRx [N_LIN_INSTANCES] |
| vuint8_t | gau8LINUARTRxFlagHasBeenClearedByTx [N_LIN_INSTANCES] |
| vuint8_t * | gpu8LINUARTTxBuffer [N_LIN_INSTANCES] |
| vuint8_t * | gpu8LINUARTRxBuffer [N_LIN_INSTANCES] |
Drivers for serial link (SCI/UART/LIN)
Copyright (c) 2011 Freescale Semiconductor Freescale Confidential Proprietary
- Author:
- Freescale Semiconductor
-
SASD Automotive
-
R11515
- Version:
- Date:
- Warning:
- (If needed)
History: